#ifndef UNIT_TYPE_H
#define UNIT_TYPE_H

#include <map>
#include <string>
#include <vector>

#include "model/Model.h"

using namespace std;

class Game;

class UnitType
{
	static map <string, UnitType*> unit_types;
	
	string name;
	
	//vector <Resource> required_resources;
	//BuildingType *producer;
	
	unsigned attack_damage;		// Damage per attack
	unsigned attack_rate;		// Time between attacks (millisecond)
	unsigned build_speed;		// How long it takes to build this unit (milliseconds)
	unsigned initial_health;
	unsigned speed;				// How fast this unit moves (small map grid squares / millisec)
	
	Model m;
	
public:
	UnitType(string name, unsigned Attack_damage, unsigned Attack_rate, unsigned Build_speed, unsigned Initial_health,
			 unsigned Speed);
	
	static void load_from_file(string file_name);
	static UnitType* find_unit_type_by_name(string unit_type_name);
	
	string get_name();
	
	unsigned get_initial_health();
	unsigned get_attack_damage();
	unsigned get_attack_rate();
	unsigned get_speed();
	unsigned get_build_speed();
	Model get_model();
};

#endif
